package com.ev.hr.vo;/**
 * @Author xy
 * @Date 2020/5/18 10:27
 * @Description
 */

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

/**
 * 文件名称： com.ev.hr.vo.AttendanceRecordImportParam.java</br>
 * 初始作者： xy</br>
 * 创建日期： 2020/5/18 10:27</br>
 * 功能说明： TODO <br/>
 * =================================================<br/>
 * 修改记录：<br/>
 * 修改作者        日期       修改内容<br/>
 * ================================================<br/>
 * Copyright (c) 2020-2021 .All rights reserved.<br/>
 */
@Data
public class AttendanceRecordImportParam implements IExcelModel {
    private static final long serialVersionUID = 1L;
    //所属时期
    @Excel(name = "所属时期")
    @Pattern(regexp = "[0-9]{4}-[0-9]{2}",message = "月份必须为“yyyy-MM”格式")
    @NotNull(message = "不可以为空")
    private String period;
    //工号
    @Excel(name = "工号")
    @NotNull(message = "不可以为空")
    private String employeeCode;
    //姓名
    @Excel(name = "姓名")
    @NotNull(message = "不可以为空")
    private String employeeName;
    //出勤
    @Excel(name = "出勤")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal attendanceTime = BigDecimal.ZERO;
    //日班
    @Excel(name = "日班")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal dayShiftTime = BigDecimal.ZERO;
    //夜班
    @Excel(name = "夜班")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal nightShiftTime = BigDecimal.ZERO;
    //病假
    @Excel(name = "病假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal sickLeaveTime = BigDecimal.ZERO;
    //事假
    @Excel(name = "事假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal comLeaveTime = BigDecimal.ZERO;
    //旷工
    @Excel(name = "旷工")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal absenteeismTime = BigDecimal.ZERO;
    //加班
    @Excel(name = "加班")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal overTime = BigDecimal.ZERO;
    //调休
    @Excel(name = "调休")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal compensatoryTime = BigDecimal.ZERO;
    //法定加班
    @Excel(name = "法定加班")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal legalOverTime = BigDecimal.ZERO;
    //婚丧
    @Excel(name = "婚丧")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal marriageFuneralTime = BigDecimal.ZERO;
    //产假
    @Excel(name = "产假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal maternityLeaveTime = BigDecimal.ZERO;
    //护理假
    @Excel(name = "护理假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal nursingLeaveTime = BigDecimal.ZERO;
    //哺乳假
    @Excel(name = "哺乳假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal lactationLeaveTime = BigDecimal.ZERO;
    //休息
    @Excel(name = "休息")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal restTime = BigDecimal.ZERO;
    //年假
    @Excel(name = "年假")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal annualLeaveTime = BigDecimal.ZERO;
    //值班
    @Excel(name = "值班")
    @DecimalMin(value = "0",message = "不允许负数")
    @Builder.Default
    private BigDecimal dutyTime = BigDecimal.ZERO;

    //错误信息
    private String message;

    /**
     * 获取错误数据
     *
     * @return
     */
    @Override
    public String getErrorMsg() {
        return message;
    }

    /**
     * 设置错误信息
     *
     * @param errorMsg
     */
    @Override
    public void setErrorMsg(String errorMsg) {
        this.message = errorMsg;
    }
}
